const mongoose = require("mongoose");
const base_model = require("./base_model");
const Schema = mongoose.Schema;

const articleSchema = new mongoose.Schema({
  ...base_model,
  title: { type: String, required: true },
  description: { type: String, required: true },
  body: { type: String, required: true },
  tagList: { type: [String], default: null },
  favoriteCount: { type: Number, default: 0 },
  author: { type: Schema.Types.ObjectId, ref: "User", required: true },
});

module.exports = articleSchema;
